package com.muyu.system.danmo.service;

import com.muyu.system.danmo.dto.CloseDTO;
import com.muyu.system.danmo.dto.PayServiceDTO;
import com.muyu.system.danmo.dto.PaymentCallBackResult;
import com.muyu.system.danmo.dto.RefundServiceDTO;
import com.muyu.common.core.enums.PayChannel;
import com.muyu.system.danmo.vo.PayServiceVO;
import com.muyu.system.danmo.vo.RefundResultServiceVO;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;

import javax.servlet.http.HttpServletRequest;
import javax.validation.Valid;

/**
 * @author Administrator
 */
public interface PayService {

    /**
     * 支付
     * @param payServiceDTO
     * @return
     */
    PayServiceVO pay(PayServiceDTO payServiceDTO);

    /**
     * 处理回调的信息
     * @param request
     */
    ResponseEntity.BodyBuilder payNotify(HttpServletRequest request, PayChannel payChannel, String mchCode);


    /**
     * 处理退款回调的信息（目前只有微信）
     * @param request
     */
    ResponseEntity.BodyBuilder refundPayNotify(HttpServletRequest request, PayChannel payChannel, String mchCode);


    /**
     * 保存订单信息
     * @param paymentCallBackResult
     */
    void completeOrder(PaymentCallBackResult paymentCallBackResult);


    /**
     * 退款
     * @param refundDTO
     * @return
     */
    RefundResultServiceVO refund(RefundServiceDTO refundDTO);


    /**
     * 保存退款订单信息
     */
    void completeRefundOrder(RefundResultServiceVO refundResultServiceVO);


    /**
     * 关闭订单
     * @param closeDTO
     */
    void close(CloseDTO closeDTO);


}
